<template>
	<view class="flex-col justify-start page">
		<view class="flex-col section">
			<u-navbar title="创作" :is-back="false" title-color="#fff" :background="background"></u-navbar>
			<view class="flex-col self-stretch items-center group">
				<view class="flex-row" style="width: 100%;">
					<view class="flex-col items-center" style="width: 70%;">
						<view v-if="!videoPath" class="flex-col items-center justify-center section_2"
							@click="checkPur(1)">
							<view class="">
								<image class="add-video-img"
									src="https://terminator.axu9.com/images/add-video-img.png" />
							</view>
							<view class="flex-row items-center justify-center">
								<image class="self-start image_2"
									src="https://terminator.axu9.com/images/add-icon1.png" />
								<text class="self-center font">添加视频</text>
							</view>

						</view>
						<view v-if="videoPath" class="flex-row justify-center video-wrap relative">
							<!-- <video :play-strategy="1" class="video-class" :src="videoPath" controls="controls"></video> -->
							<video :play-strategy="1" class="video-class" :src="videoPath" controls="controls"></video>
							<view class="del-video" @click="delVideo">
								<image class="self-start del-img"
									src="https://terminator.axu9.com/images/del-video-icon.png" />
							</view>
						</view>
						<view class="flex-row justify-center" style="margin-top: 20rpx;">
							<view class="flex-row justify-center" style="width: 369rpx;white-space: nowrap;">
								<u-radio-group v-model="modeValue" @change="radioGroupChange">
									<u-radio v-for="(item, index) in modeList" :key="index" :name="item.name"
										shape="circle" active-color="#00e090" :disabled="item.disabled">
										{{item.name}}
									</u-radio>
								</u-radio-group>
							</view>

						</view>

					</view>
					<!-- height: 656rpx; -->
					<view class="flex-row items-center" style="height: 656rpx;width: 30%;">
						<scroll-view scroll-y class="flex-col" style="height: 620rpx;"
							v-if="historyVideoList.length > 0" @scrolltolower="reachBottom">
							<!-- <view class="flex-col history-list"> -->

							<view class="flex-col" style="position: relative;width: 140rpx;margin-top: 20rpx;"
								@click="selectVideo(item.video,index,item.type)"
								v-for="(item,index) in historyVideoList">
								<!-- <video :play-strategy="1" :class="currentVideoIndex == index ? 'border-green' : ''" :src="item.video" object-fit="cover"
										class="video-poster" :show-center-play-btn="false" :controls="false" :vslide-gesture-in-fullscreen="false"></video> -->
								<image :class="currentVideoIndex == index ? 'border-green' : ''" :src="item.img"
									class="video-poster" mode="aspectFill"></image>
								<view class="close-video-img-wrap" @click.stop="openDelModel(item.id)">
									<image class="close-video-img"
										src="https://terminator.axu9.com/images/close-icon-white-video.png" mode="">
									</image>
								</view>
							</view>
							<!-- </view> -->
						</scroll-view>
					</view>

				</view>
				<view class="mt-10 flex-col self-stretch section_3">
					<view class="flex-row justify-between items-center">
						<text class="self-start font" style="height: 60rpx;line-height: 60rpx;">音频内容</text>
						<view class="select-audio" @click="toAudioHome">
							选择音频
						</view>
					</view>
					<view v-if="audioTitle == ''" class="flex-col justify-start self-stretch mt-10"
						@click="checkPur(2)">
						<view class="section_4 flex-row items-center">
							<image class="image_3" src="https://terminator.axu9.com/images/add-icon1.png" />
							<text class="text_2">添加音频</text>
						</view>

					</view>

					<view v-else class="flex-col justify-start self-stretch mt-10" @click="playAudio">
						<view class="flex-row items-center section_33 justify-between"
							:class="isPlay == true ? 'border-green' : ''">
							<view class="flex-row items-center section_33_lf">
								<image class="image_33"
									src="https://terminator.axu9.com/images/audio-select-icon.png" />
								<view class="flex-col justify-center" style="width: 60%;">
									<text class="text_44 ml-3-5">{{audioTitle}}</text>
									<text class="text_44 ml-3-5" style="margin-top: 10rpx;">{{duration}}</text>
								</view>
								<!-- <text class="text_44 ml-3-5">{{audioTitle}}</text> -->
								<text v-if="audioHCStatus == 0" class="text_status">生成中...</text>
								<text v-if="audioHCStatus == 2" class="text_status">失败</text>
								<text v-if="audioHCStatus == 3" class="text_status">音色下架</text>
							</view>

							<image @click.stop="delAudio" class="image_34"
								src="https://terminator.axu9.com/images/del-icon-white.png" />
						</view>

					</view>
				</view>
			</view>

			<view class="flex-col justify-start items-center group_2">
				<view class="num">
					本次合成需要<text class="num-green">{{score}}</text>分
				</view>
				<!-- <view @click="create" v-if="!isLoading" class="section_5 flex-row justify-center items-center">
					<text class="font">生成</text>
				</view>
				<view v-else class="section_5 flex-row justify-center items-center">
					<text class="font">生成1111</text>
				</view> -->
				<view @click="create" class="section_5 flex-row justify-center items-center">
					<text class="font">生成</text>
				</view>
				<view class="num mt-10 flex-row items-center">
					<image v-if="!checked" @click="changAgree" class="image_check"
						src="https://terminator.axu9.com/images/uncheck.png" />
					<image v-else @click="changAgree" class="image_check"
						src="https://terminator.axu9.com/images/checked.png" />
					<text class="agreement-text1">我知晓同意</text>
					<text @click="toAgreement" class="agreement-text2">《{{createAgreeTitle}}》</text>
				</view>
			</view>
			<!-- <u-popup v-model="showPop1" mode="center" :custom-style="customStyle" :mask-custom-style="maskCustomStyle"
				@close="close" :mask-close-able="false">
				<view class="flex-col flex-1 popup1 ml-7-5" v-if="showPop1">
					<text class="self-center title1">生成视频</text>
					<view class="flex-col items-center mt-16-5">
						<view class="content">
							<view v-if="modeType=='标清'" class="pop-card-num flex-row justify-start items-center">
								预计生成时间：{{integal<10 ? '1分钟' : formatMin(integal*6)}}
								
							</view>
							<view v-if="modeType=='高清(上传慢)'" class="pop-card-num flex-row justify-start items-center">
								预计生成时间：{{ integal<10 ? '5分钟' : formatMin(integal*30)}}
							</view>
							<view class="pop-card-num flex-row justify-start items-center mt-27">
								消耗积分：{{integal}}
							</view>
						</view>
						<view class="flex-row bottom-btn justify-between">
							<view @click="cancel" class="flex-col justify-start items-center agree-btn1">
								<text class="font-noagree">取消</text>
							</view>
							<view v-if="!isLoading" @click="integralSubmit"
								class="flex-col justify-start items-center noagree-btn1">
								<text class="font-agree">确定</text>
							</view>
							<view v-if="isLoading" class="flex-col justify-start items-center noagree-btn1">
								<text class="font-agree">确定111</text>
							</view>
						</view>
					</view>
				</view>
			</u-popup> -->
			<!-- 登录弹窗 -->
			<ns-login ref="login" @loginSuccess="loginSuccess"></ns-login>
			<!-- 绑定手机号弹窗 -->
			<bind-phone ref="bindPhone" @bindSuccess="bindSuccess"></bind-phone>
			<!-- 展示消耗积分 生成时长弹窗 -->
			<showIntegalPop ref="integalPop" :integal="score" @confirm="showIntegalConfirm" @cancel="showIntegalCancel">
			</showIntegalPop>
			<!-- ios手机上传视频提示弹窗 -->
			<iosVideoPopTips ref="iosTipsPop"></iosVideoPopTips>
			<!-- 上传视频进度条弹窗 -->
			<progressPop ref="progressPop" :isShow="true" :percent="percent" @cancel="showProgressCancel"></progressPop>
			<!-- showLoading加载弹窗 -->
			<loadingPop ref="loadingPop"></loadingPop>

		</view>
	</view>
</template>

<script>
	import nsLogin from "../../components/ns-login/ns-login.vue";
	import bindPhone from "../../components/bindPhone/index.vue";
	import showIntegalPop from "../../components/showIntegalPop/index.vue";
	import iosVideoPopTips from "../../components/iosVideoPopTips/index.vue";
	import progressPop from "../../components/progressPop/index.vue";
	import loadingPop from "../../components/loadingPop/index.vue"
	import {
		getAudioDuration,
		lipsync,
		VideoAnimate,
		newShipin,
		verify,
		videoLog,
		videoList,
		videoDelHist,
		getAgreement
	} from "@/api/video.js"
	import {
		mp3Status
	} from "@/api/audio.js"
	import {
		checkUserInfo,
		getQiniuToken,
		getUserinfo
	} from "@/api/user.js"
	import {
		completQiniuUploadUrl,
		qiniuDomainUrlD,
		baseURL1
	} from "@/api/request.js"
	// import auth from 'common/js/auth.js';
	export default {
		data() {
			return {
				modeValue: '',
				modeList: [{
						name: '标清',
						disabled: false,
						checked: false
					},
					{
						name: '高清(上传慢)',
						// name: '高清',
						disabled: false,
						checked: false
					}
				],
				videoPath: '', //视频路径
				audioUrl: '', //音频路径
				videoTitle: '', //视频标题
				// voiceName: '职场女性职场箴言.mp3',
				audioTitle: '',
				background: {
					backgroundColor: 'rgba(0,0,0,0)',
				},
				score: '0',
				showPop1: false, //设置视频标题弹窗
				maskCustomStyle: {
					background: 'rgba(0, 0, 0, 1)'
				},
				audioIndex: -1, //播放的index
				innerAudioContext: null,
				playIndex: -1, //点击的index
				isPlay: false, //false未播放 true播放中 
				audioId: '', //音频id
				timer: null, //定时器--查看生成音频状态
				audioHCStatus: 1, //0生成中 1成功 2失败 3音色下架
				duration: '', //时长
				isLoading: false, //false可以点击确定按钮 true不可以点击
				historyVideoList: [], //历史视频记录
				currentVideoIndex: -1,
				progress: uni.getStorageSync("progress"),
				yTime: 0, //预计生成时间
				page: 1, //分页--当前页数
				totalPage: 1, //分页--总页数
				percent: 0, //进度条
				uploadTask: null, //上传视频任务
				checked: false, //创作协议是否勾选 false未勾选 true勾选
				createAgreeTitle: '用户视频创作协议', //视频创作协议标题
				showPop1: true,
				level: 0, //身份 0普通用户 1激活用户 2银牌 3金牌
			}
		},
		components: {
			nsLogin,
			bindPhone,
			showIntegalPop,
			iosVideoPopTips,
			progressPop,
			loadingPop
		},
		watch: {

			// progress(oldValue,newValue){
			// 	console.log(oldValue,newValue,'监听')
			// }
		},
		onShow() {

			// this.$refs.bindPhone.open();
			// this.timer1 = setInterval(()=>{
			// 	if(this.percent >= 100){
			// 		clearInterval(this.timer1)
			// 		return
			// 	}
			// 	this.percent++;
			// },100)
			if (!uni.getStorageSync("videoMode")) {
				uni.setStorageSync("videoMode", '标清')
			}
			this.checked = uni.getStorageSync("createAgreeCheck") ? uni.getStorageSync("createAgreeCheck") : false;
			this.modeValue = uni.getStorageSync("videoMode") ? uni.getStorageSync("videoMode") : '标清'
			// setTimeout(()=>{
			// 	this.progress = 20
			// },2000)
			// this.progress = uni.getStorageSync("progress")
			// this.$refs.bindPhone.open();
			// uni.hideLoading();
			// this.showPop1 = false;
			console.log(this.audioUrl, 'this.audioUrl')

			if (!uni.getStorageSync("userId")) {
				uni.hideShareMenu({
					menus: ['shareAppMessage']
				})
			} else {
				uni.showShareMenu({
					withShareTicket: true,
					menus: ['shareAppMessage']
				})
			}

			if (!uni.getStorageSync('userId')) {
				this.$refs.login.open()
				return
			}
			if (this.audioId != '') {
				this.getAudioStatus();

				this.timer = setInterval(() => {
					this.getAudioStatus();
				}, 1000)

			}
			console.log(this.innerAudioContext, !this.innerAudioContext, 'this.innerAudioContext')
			this.historyVideoList = [];
			this.page = 1;
			this.getVideoList();
			this.getXieyi();
			this.getUserinfo();
			// if(!this.innerAudioContext){
			// 	this.contextInit();
			// }

		},
		async onLoad(options) {
			console.log(options, 'create options')
			this.audioTitle = options.audioTitle ? options.audioTitle : '';
			this.audioUrl = options.audioUrl ? options.audioUrl : '';
			this.videoPath = options.videoPath ? options.videoPath : '';
			this.modeValue = options.modeValue ? options.modeValue : '标清';
			this.audioId = options.audioId ? options.audioId : '';
			// this.duration = options.duration ? options.duration : '';
			// this.score = options.integral ? options.integral : 0;
			console.log(this.audioUrl, 'this.audioUrl')
			if (JSON.stringify(options) != '{}' && options.id) {
				console.log('走了么')
				uni.setStorageSync("parentId", options.id)
			}
			// // await this.contextInit();
			// if (this.audioUrl != '') {
			// 	this.getNeedScore(this.audioUrl)
			// }
		},
		created() {
			// this.contextInit();
		},
		// onUnload() {
		// 	console.log('onUnload')
		// },
		onHide() {
			console.log('onhide')
			this.$refs.login.close()
			// uni.hideLoading();
			if (this.timer) {
				clearInterval(this.timer)
			}
			if (this.innerAudioContext) {
				this.isPlay = false;
				// this.innerAudioContext.src = '';
				this.innerAudioContext.stop();
				this.innerAudioContext.destroy();
				this.innerAudioContext = null;
			}
			// this.$refs.iosTipsPop.close();
		},
		onUnload() {
			console.log('onUnload')
			if (this.innerAudioContext) {
				this.isPlay = false;
				// this.innerAudioContext.src = '';
				this.innerAudioContext.stop();
				this.innerAudioContext.destroy();
				this.innerAudioContext = null;
			}
		},
		beforeDestroy() {
			console.log('beforeDestroy', this.innerAudioContext)
			if (this.innerAudioContext) {
				this.isPlay = false;
				// this.innerAudioContext.src = '';
				this.innerAudioContext.stop();
				this.innerAudioContext.destroy();
				this.innerAudioContext = null;
			}
		},
		onShareAppMessage: function(res) {
			// 返回分享的内容
			let userId = uni.getStorageSync("userId") ? uni.getStorageSync("userId") : ''
			return {
				title: '创作', // 分享标题  
				path: '/pages/create/index?id=' + userId, // 分享路径，可以带参数  
				success: function(res) {
					// 设置成功  
				},
				fail: function(res) {
					// 设置失败  
				}
			}
		},
		// onShareTimeline(){},//分享朋友圈
		methods: {
			// 获取用户信息
			getUserinfo() {
				getUserinfo({
					uid: uni.getStorageSync("userId")
				}).then(res => {
					console.log(res.data, 'getUserinfo')
					this.level = res.data.level_id;
				}).catch(err => {
			
				})
			},
			// integralSubmit() {
			// 	if (this.isLoading) {
			// 		// 如果按钮在间隔时间内被点击，不执行操作并提示
			// 		uni.showToast({
			// 			title: '请勿重复点击',
			// 			icon: 'none',
			// 		});
			// 		return;
			// 	}
			// 	this.isLoading = true
			// 	console.log('jjjj')
			// 	setTimeout(() => {
			// 		this.isLoading = false;
			// 	}, 2000)
			// },
			// 跳转到协议
			toAgreement() {
				uni.navigateTo({
					url: '/pagesMine/agreement/index?type=4'
				})
			},
			// 视频创作协议
			getXieyi() {
				getAgreement({
					id: 4
				}).then(res => {
					if (res.errno == 0) {
						this.createAgreeTitle = res.data.title;
					}
				})
			},
			changAgree() {
				this.checked = !this.checked;
				uni.setStorageSync("createAgreeCheck",this.checked)
			},
			generateRandomString(length) {
				const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
				let result = '';
				const charactersLength = characters.length;
				for (let i = 0; i < length; i++) {
					result += characters.charAt(Math.floor(Math.random() * charactersLength));
				}
				return result;
			},
			// 七牛上传接口封装
			uploadQiniuReauest(videoUrl, imgUrl) {
				// uni.showLoading({
				// 	title: '上传中'
				// })

				var timestamp = Date.now();
				var userId = uni.getStorageSync('userId');
				var name = userId + '/' + this.generateRandomString(8) + timestamp;

				var _this = this;
				getQiniuToken().then(res => {
					let token = res.data;
					console.log(res.data, '获取七牛token')
					_this.uploadTask = uni.uploadFile({
						filePath: videoUrl,
						name: 'file',
						url: completQiniuUploadUrl,
						timeout: 1000000,
						formData: {
							token: token,
							key: name
						},
						success: (uploadFileRes) => {
							uni.hideLoading()
							let logo = JSON.parse(uploadFileRes.data);
							console.log(logo, 'logo')
							if (logo.key) {
								console.log(qiniuDomainUrlD + logo.key, '上传路径');
								_this.videoPath = qiniuDomainUrlD + logo.key
								// resolve(qiniuDomainUrl + logo.key)
								_this.uploadImg(_this.videoPath, imgUrl);
							} else {
								uni.showToast({
									title: '上传失败',
									icon: 'error'
								})
								_this.$refs.progressPop.close();
							}

						},
						fail: (err) => {
							uni.hideLoading()
							uni.showToast({
								title: '上传失败',
								icon: 'none'
							})
							// reject(err)
						}
					})
					// 监听上传进度  
					_this.uploadTask.onProgressUpdate((res) => {
						// this.uploadPercent = res.progress; // 更新进度条  
						// console.log('上传进度', res.progress);
						this.percent = res.progress;
						if (this.percent >= 100) {
							this.$refs.progressPop.close();
							setTimeout(() => {
								this.percent = 0;
							}, 1000)


						}
						// console.log('已经上传的数据长度', res.totalBytesSent);
						// console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend);
					});
				})


			},
			showProgressCancel() {
				console.log('关闭上传弹窗')
				this.uploadTask.abort();
				this.uploadTask = null;
			},
			// 视频记录触底事件
			reachBottom() {
				console.log('到底了')
				if (this.page < this.totalPage) {
					this.page++;
					this.getVideoList();
				} else {
					uni.showToast({
						title: '已加载全部',
						icon: 'none'
					})
				}
			},
			radioGroupChange(e) {
				console.log(e, '单选变化')
				this.modeValue = e;
				uni.setStorageSync("videoMode", e)

				if (e == '高清(上传慢)') {
					// this.$refs.iosTipsPop.open();
					var _this = this;
					// _this.$refs.iosTipsPop.open();
					// 获取手机系统信息
					uni.getSystemInfo({
						success: function(info) {
							console.log(info, 'info')
							var platform = info.platform;
							if (platform == 'ios') {
								_this.$refs.iosTipsPop.open();
							}

						}
					});
				}

			},
			// 选择视频
			selectVideo(video, index, type) {
				this.currentVideoIndex = index;
				this.videoPath = video;
				this.modeValue = type ? type : '标清';
				uni.setStorageSync("videoMode", this.modeValue)
			},
			openDelModel(id) {
				var _this = this;
				uni.showModal({
					title: '提示',
					content: '确定删除该视频么？',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							_this.delVideoHist(id);
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			// 删除历史视频记录
			delVideoHist(id) {
				videoDelHist({
					id: id
				}).then(res => {
					if (res.errno == 0) {
						uni.showToast({
							title: '成功',
							icon: 'none',
							duration: 1000
						})
						this.historyVideoList = [];
						this.page = 1;
						this.getVideoList();
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}).catch(err => {
					uni.showToast({
						title: '出错了',
						icon: 'none'
					})
				})
			},
			// 获取历史视频记录
			getVideoList() {
				videoList({
					uid: uni.getStorageSync("userId"),
					page: this.page
				}).then(res => {
					console.log(res, '获取视频记录')
					if (res.errno == 0) {

						this.totalPage = res.data.last_page;
						this.historyVideoList = [...this.historyVideoList, ...res.data.data];
					}
				})
			},
			// 添加历史视频记录
			setVideoLog(videoUrl, imgUrl) {
				videoLog({
					uid: uni.getStorageSync("userId"),
					video: videoUrl,
					img: imgUrl,
					type: this.modeValue
				}).then(res => {
					console.log(res, '添加历史视频记录')
					if (res.errno == 0) {
						this.historyVideoList = [];
						this.page = 1;
						this.getVideoList();
					}
				})
			},

			// 根据音频id获取生成音频状态
			getAudioStatus() {
				mp3Status({
					id: this.audioId,
				}).then(res => {
					console.log(res, '成功')
					this.audioHCStatus = res.data.status

					if (this.audioHCStatus == 1) {
						clearInterval(this.timer)
						this.audioUrl = res.data.mp3;
						this.score = res.data.integral;
						this.duration = res.data.duration;

						// this.getNeedScore(this.audioUrl)
					} else if (this.audioHCStatus == 2 || this.audioHCStatus == 3) {
						clearInterval(this.timer)
					}
				})
			},
			async contextInit() {
				let that = this;
				var innerAudioContext = uni.createInnerAudioContext();
				innerAudioContext.autoplay = false;
				innerAudioContext.src = '';

				innerAudioContext.loop = false;
				innerAudioContext.onPlay(() => {
					that.isPlay = true;
					console.log('开始播放', that.audioIndex);
					uni.hideLoading();
				});
				innerAudioContext.onPause(() => {
					that.isPlay = false;
					console.log('暂停播放');
					uni.hideLoading();
				});
				innerAudioContext.onTimeUpdate(function(res) {
					// console.log(res, 'onTimeUpdate')
					// that.audioTimeUpdate = sToHs(Math.floor(innerAudioContext.currentTime));
				});
				innerAudioContext.onEnded(function() {
					that.isPlay = false;
					console.log('结束播放');
					// that.innerAudioContext.destroy();
					uni.hideLoading();
				});
				innerAudioContext.onStop(function() {
					that.isPlay = false;
					console.log('结束播放');
					// that.innerAudioContext.destroy();
					uni.hideLoading();
				});

				innerAudioContext.onError((res) => {
					console.log(res, 'error')

					uni.hideLoading();
					uni.showToast({
						title: '加载失败',
						icon: 'none'
					})
				});
				that.innerAudioContext = innerAudioContext
			},
			delVideo() {
				this.videoPath = ''
			},
			// 打开显示上传时间 消耗积分弹窗
			openShowIntegalPop() {
				console.log('hahah')
				this.$refs.integalPop.open();
			},
			// 确认显示上传时间 消耗积分弹窗
			showIntegalConfirm() {

				// this.isLoading = true;
				console.log(this.isLoading)
				var _this = this;
				_this.isVerify();
				// _this.submit()
				
				// uni.requestSubscribeMessage({
				// 	tmplIds: ['tyWKCHrX55ykOgzhxLedeItK3JK8p2SdPB4vuwDb4zw'],
				// 	success(res) {
				// 		console.log(res, 'success')
				// 	},
				// 	fail(err) {
				// 		console.log(err, 'fail')
				// 	},
				// 	complete(res) {
				// 		console.log(res, 'complete')
				// 		_this.submit();
				// 	}
				// })
			},
			// 取消显示上传时间 消耗积分弹窗
			showIntegalCancel() {
				this.isLoading = false;
			},
			// 校验是否可以生成视频
			isVerify() {
				var _this = this;
				// _this.isLoading = true;
				verify({
					uid: uni.getStorageSync("userId"),
					integral: this.score, //消耗的积分
					title: this.videoTitle, //视频标题
					audioUrl: this.audioUrl, //音频路径
					videoUrl: this.videoPath //视频路径
				}).then(res => {
					console.log(res, 'ddddddd')
					if (res.errno == 0) {
						// this.openShowIntegalPop();
						uni.requestSubscribeMessage({
							tmplIds: ['tyWKCHrX55ykOgzhxLedeItK3JK8p2SdPB4vuwDb4zw'],
							success(res) {
								console.log(res, 'success')
							},
							fail(err) {
								console.log(err, 'fail')
							},
							complete(res) {
								console.log(res, 'complete')
								_this.submit();
							}
						})
						// _this.submit();


					} else {
						_this.isLoading = false;
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}

				}).catch(err => {
					_this.isLoading = false;
				})
			},
			async playAudio() {
				if (this.audioHCStatus == 0) {
					uni.showToast({
						title: '音频暂未生成',
						icon: 'none'
					})
					return
				}
				if (this.audioHCStatus == 2) {
					uni.showToast({
						title: '音频生成失败',
						icon: 'none'
					})
					return
				}
				if (this.isPlay) {
					if (this.innerAudioContext.paused) {
						this.innerAudioContext.src = this.audioUrl;

						uni.showLoading({
							title: '加载音频中'
						})

						this.innerAudioContext.play()
					} else {
						this.innerAudioContext.stop()
					}
				} else {
					await this.contextInit();
					this.innerAudioContext.src = this.audioUrl;

					uni.showLoading({
						title: '加载音频中'
					})

					this.innerAudioContext.play()
				}






				// if (this.innerAudioContext.paused) {
				// 	this.innerAudioContext.src = this.audioUrl;

				// 	uni.showLoading({
				// 		title: '加载音频中'
				// 	})

				// 	this.innerAudioContext.play()
				// } else {
				// 	this.innerAudioContext.pause()
				// }
			},
			// 删除音频
			delAudio() {
				this.audioTitle = '';
				this.audioUrl = '';
				this.score = 0;
				this.audioId = '';
				if (this.timer) {
					clearInterval(this.timer)
				}
				if (this.innerAudioContext) {
					this.innerAudioContext.stop();
				}


			},
			// 登陆成功
			loginSuccess() {
				console.log('登录成功')
				this.historyVideoList = [];
				this.page = 1;
				this.getVideoList();
				uni.showShareMenu({
					withShareTicket: true,
					menus: ['shareAppMessage']
				})
				if (uni.getStorageSync("mobile") == '') {
					console.log('111')
					this.$refs.bindPhone.open();
				}
			},
			// 绑定手机号
			bindSuccess() {
				console.log('绑定手机号成功')
				uni.showShareMenu({
					withShareTicket: true,
					menus: ['shareAppMessage']
				})
				this.historyVideoList = [];
				this.page = 1;
				this.getVideoList();
			},
			checkDaili(type){
				checkUserInfo({
					uid: uni.getStorageSync("userId")
				}).then(res => {
					console.log(res, 'checkUserInfo')
					if (res.errno == 0) {
						if (type == 1) {
							this.chooseVideo()
						} else if (type == 2) {
							this.addVideo()
						}
				
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				
				}).catch(err => {
				
				})
			},
			// 验证代理商信息 type==1视频 type==2音频
			checkPur(type) {
				// if(this.level==0) {
				// 	uni.showToast({
				// 		title: '请激活会员',
				// 		icon: 'none'
				// 	})
				// }else {
				// 	this.checkDaili(type);
				// }
				this.checkDaili(type);
				

			},
			chooseVideoStepTwo(sizeType) {
				console.log(sizeType)
				var _this = this;
				uni.chooseMedia({
					count: 1,
					mediaType: ['video'],
					sourceType: ['album'],
					sizeType: sizeType,
					success: (res) => {
						console.log(res, 'dddddd')
						_this.$refs.progressPop.open();
						// 现在可以将视频上传到服务器
						// console.log(this.videoPath, 'this.videoPath')
						// _this.uploadVideo(res.tempFilePath);
						// _this.uploadImg(res.thumbTempFilePath);
						// 在这里处理压缩后的视频路径 compressRes.tempFilePath
						_this.uploadQiniuReauest(res.tempFiles[0].tempFilePath, res.tempFiles[0]
							.thumbTempFilePath)
						// if (_this.modeValue == '标清') {
						// 	console.log(res.tempFiles[0].tempFilePath, res.tempFiles[0].thumbTempFilePath,'llllllll')
						// 	_this.compressVideo(res.tempFiles[0].tempFilePath, res.tempFiles[0].thumbTempFilePath)
						// } else {
						// 	// _this.uploadVideoQiniu(res.tempFiles[0].tempFilePath, res.tempFiles[0]
						// 	// 	.thumbTempFilePath);
						// 	_this.uploadQiniuReauest(res.tempFiles[0].tempFilePath, res.tempFiles[0].thumbTempFilePath)
						// }

						// uni.getVideoInfo({
						// 	src: res.tempFiles[0].tempFilePath,
						// 	success: function(compressRes) {
						// 		console.log('获取视频信息成功', compressRes);

						// 	},
						// 	fail: function(err) {
						// 		console.error('获取视频信息失败', err);
						// 	}
						// })


						// _this.uploadVideoQiniu(res.tempFiles[0].tempFilePath,res.tempFiles[0].thumbTempFilePath);
					},
					fail: (err) => {
						console.log('选择视频失败：', err);
					}
				})
			},
			chooseVideo() {
				var _this = this;
				var sizeType;
				// 获取手机系统信息
				uni.getSystemInfo({
					success: function(info) {
						console.log(info, 'info')
						var platform = info.platform;
						if (platform == 'ios') {
							// sizeType = _this.modeValue == '标清' ? ['compressed'] : ['compressed','original'];
							sizeType = _this.modeValue == '标清' ? ['compressed'] : ['original'];
							_this.chooseVideoStepTwo(sizeType);
						} else {
							// sizeType = ['original','compressed'];
							sizeType = _this.modeValue == '标清' ? ['compressed', 'original'] : ['original'];
							_this.chooseVideoStepTwo(sizeType);
						}

					}
				});

				// let sizeType = ['original', 'compressed'];

				// uni.chooseVideo({
				// 	sourceType: ['album'], // 从相册或相机选择视频
				// 	camera: 'back', // 默认使用后置摄像头，可以指定front为前置
				// 	maxDuration: 60, // 视频最大持续时间，默认60秒
				// 	compressed:false,//是否压缩所选的视频源文件，默认值为 true，需要压缩。
				// 	success: (res) => {
				// 		console.log(res,'dddddd')
				// 		// 现在可以将视频上传到服务器
				// 		// console.log(this.videoPath, 'this.videoPath')
				// 		// _this.uploadVideo(res.tempFilePath);
				// 		// _this.uploadImg(res.thumbTempFilePath);
				// 		_this.uploadVideoQiniu(res.tempFilePath,res.thumbTempFilePath);
				// 	},
				// 	fail: (err) => {
				// 		console.log('选择视频失败：', err);
				// 		uni.showToast({
				// 			title: '选择失败',
				// 			icon: 'none'
				// 		})
				// 	}
				// });
			},
			compressVideo(videoUrl, imgUrl) {
				var _this = this;
				uni.compressVideo({
					src: videoUrl, // 视频文件路径
					quality: 'high', // 压缩质量 low size小 medium high size大
					// bitrate: compressRes.bitrate *0.5, //码率，单位 kbps（仅 iOS 支持）
					// fps: compressRes.bitrate * 0.5, //帧率（仅 iOS 支持）
					// resolution: compressRes.resolution, //相对于原视频的分辨率比例，取值范围(0, 1]（仅 iOS 支持）
					success: function(compressRes) {
						console.log('压缩成功', compressRes);
						// 在这里处理压缩后的视频路径 compressRes.tempFilePath
						// _this.uploadVideoQiniu(compressRes
						// 	.tempFilePath, imgUrl);
						_this.uploadQiniuReauest(compressRes.tempFilePath, imgUrl)
					},
					fail: function(err) {
						console.error('压缩失败', err);
					}
				});
			},
			uploadVideo(filePath) {
				var _this = this;
				_this.$uploadVideo(filePath).then(res => {
					console.log(res, 'uploadVideo')
					if (res.data.errno == 1) {
						_this.videoPath = res.data.img
						console.log(_this.videoPath, '上传视频')
						_this.setVideoLog(_this.videoPath);
						// if(!_this.innerAudioContext){
						// 	_this.contextInit();
						// }

						// uni.downloadFile({
						// 	url: _this.videoPath,
						// 	success: function(res) {
						// 		var filePath = res.tempFilePath;
						// 		console.log(res, 'reeeeee')
						// 		uni.saveVideoToPhotosAlbum({
						// 			filePath: res.tempFilePath,
						// 			success: res => {

						// 			}
						// 		})
						// 	},
						// 	fail: function(err) {
						// 		uni.hideLoading();
						// 		console.log(err, 'errr')
						// 		uni.showToast({
						// 			title: '下载失败',
						// 			icon: 'none'
						// 		})
						// 	}
						// })

					} else {
						uni.showToast({
							title: res.data.message,
							icon: 'none'
						})
					}


				}).catch(err => {
					console.log(err, 'err')

				})


			},
			// 上传视频缩略图
			uploadImg(videoUrl, imgUrl) {
				console.log(imgUrl, 'imgUrl')
				// return
				var _this = this;
				_this.$uploadAvatar(imgUrl).then(res => {
					console.log(res, 'uploadImg')
					if (res.data.errno == 1) {
						// _this.avatar_url = res.data.img
						console.log(res.data.img, '缩略图')
						_this.setVideoLog(videoUrl, res.data.img);
					} else {
						uni.showToast({
							title: res.data.message,
							icon: 'none'
						})
					}


				}).catch(err => {
					console.log(err, 'err')

				})
			},
			// 七牛上传视频
			uploadVideoQiniu(videoUrl, imgUrl) {

				var _this = this;

				_this.$uploadVideoQiniu(videoUrl).then(res => {
					console.log(res, 'uploadVideo')
					_this.videoPath = res
					console.log(_this.videoPath, '上传视频')
					console.log(_this.videoPath, imgUrl, '.......')
					_this.uploadImg(_this.videoPath, imgUrl);
					// _this.setVideoLog(this.videoPath);


				}).catch(err => {
					console.log(err, 'err')

				})


			},
			// 获取音频时长获取积分
			getNeedScore(audioUrl) {
				uni.showLoading({
					title: '获取积分中'
				})
				getAudioDuration({
					uid: uni.getStorageSync("userId"),
					Audiourl: audioUrl
				}).then(res => {
					uni.hideLoading();
					console.log(res, '获取音频时长获取积分')
					this.score = res.data.integral;
					this.duration = res.data.duration; //时长
				}).catch(err => {
					uni.hideLoading();
				})
			},
			addVideo() {
				uni.navigateTo({
					url: '/pagesCreate/addAudioOption/index?toOptionType=1' + '&videoPath=' + this.videoPath +
						'&modeValue=' + this.modeValue
				})
			},
			// 生成
			create() {
				// if(this.level == 0){
				// 	uni.showToast({
				// 		title: '请激活用户',
				// 		icon: 'none'
				// 	})
				// 	return
				// }
				if (this.videoPath == '') {
					uni.showToast({
						title: '请上传视频',
						icon: 'none'
					})
					return
				}
				if (this.audioUrl == '') {
					uni.showToast({
						title: '请上传音频',
						icon: 'none'
					})
					return
				}
				if (!this.checked) {
					uni.showToast({
						title: '请阅读并勾选协议',
						icon: 'none'
					})
					return
				}
				checkUserInfo({
					uid: uni.getStorageSync("userId")
				}).then(res => {
					console.log(res, 'checkUserInfo')
					if (res.errno == 0) {
						this.openShowIntegalPop();
				
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				
				}).catch(err => {
				
				})
				// this.showPop1 = true;
				
				// this.isLoading = true
				
				// this.isVerify();


			},
			toAudioHome() {
				uni.navigateTo({
					url: '/pagesHome/audioList/index?videoPath=' + this.videoPath
				})
			},
			hecheng4() {
				console.log(this.isLoading, 'this.isLoading1')
				// uni.request({
				// 	url: baseURL1 + 'v1.video/new_shipin', //接口地址：前缀+方法中传入的地址    
				// 	method: "POST", //请求方法：传入的方法或者默认是“GET”    
				// 	data: {
				// 		uid: uni.getStorageSync("userId"),
				// 		audioUrl: this.audioUrl,
				// 		srcVideoUrl: this.videoPath,
				// 		integral: this.score,
				// 		title: this.videoTitle,
				// 		is_zhanshi: uni.getStorageSync("isDetailAgree") ? uni.getStorageSync("isDetailAgree") : 1
				// 	}, //传递参数：传入的参数或者默认传递空集合    
				// 	header: {},
				// 	success: (
				// 		res
				// 	) => {
						
				// 		if(res.data.errno == 0){
				// 			this.showPop1 = false;
				// 			this.audioUrl = '';
				// 			this.videoPath = '';
				// 			this.videoTitle = '';
				// 			this.audioTitle = '';
				// 			this.audioId = '';
				// 			this.score = 0;
				// 			// uni.removeStorageSync("createAgreeCheck")
				// 			// this.innerAudioContext.src = '';
				// 			// this.innerAudioContext.stop()
				// 			// this.innerAudioContext.destroy()
				// 			this.innerAudioContext = null;
							
				// 		}else if (res.data.errno == 1) {
				// 			this.isLoading = false;
				// 			uni.showToast({
				// 				title: res.data.msg,
				// 				icon: 'none'
				// 			})
							
							
				// 		} else if (res.data.errno == 401) {
				
				// 			uni.navigateTo({
				// 				url: '/pages/login/index'
				// 			})
							
				// 		} else {
				// 			uni.hideLoading();
				// 			this.isLoading = false;
				// 			uni.showToast({
				// 				title: '出错了',
				// 				icon: 'none'
				// 			})
				// 		}
				// 	}, // 这里的接口请求，如果出现问题就输出接口请求失败    
				// 	fail: (err) => {
				// 		uni.hideLoading();
				// 		this.isLoading = false;
				// 		uni.showToast({
				// 			title: '出错了',
				// 			icon: 'none'
				// 		})
				// 	},
				// })
				
				newShipin({
					uid: uni.getStorageSync("userId"),
					audioUrl: this.audioUrl,
					srcVideoUrl: this.videoPath,
					integral: this.score,
					title: this.videoTitle,
					is_zhanshi: uni.getStorageSync("isDetailAgree") ? uni.getStorageSync("isDetailAgree") : 1,
					qingxi: this.modeValue == "标清" ? this.modeValue : this.modeValue.replace("高清(上传慢)", "高清")
				}).then(res => {

					console.log(res, 'res');
					this.isLoading = false;
					if (res.errno == 0) {
						this.showPop1 = false;
						this.audioUrl = '';
						this.videoPath = '';
						this.videoTitle = '';
						this.audioTitle = '';
						this.audioId = '';
						this.score = 0;
						// uni.removeStorageSync("createAgreeCheck")
						// this.innerAudioContext.src = '';
						// this.innerAudioContext.stop()
						// this.innerAudioContext.destroy()
						this.innerAudioContext = null;
						setTimeout(() => {
							// uni.hideLoading();
							this.$refs.loadingPop.close();
							uni.switchTab({
								url: '/pages/mine/index'
							})
						}, 500)

					} else {
						this.isLoading = false;
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
						this.$refs.loadingPop.close();
					}


				}).catch(err => {
					uni.hideLoading();
					this.isLoading = false;
					this.$refs.loadingPop.close();
					uni.showToast({
						title: '上传失败',
						icon: 'none'
					})
					console.log(err, 'err')
				})
			},
			hecheng3() {
				uni.request({
					url: 'https://terminator2.axu9.com/api/v1.video/lipsync', //接口地址：前缀+方法中传入的地址    
					method: "POST", //请求方法：传入的方法或者默认是“GET”    
					data: {
						uid: uni.getStorageSync("userId"),
						audioUrl: this.audioUrl,
						videoUrl: this.videoPath,
						integral: this.score,
						title: this.videoTitle
					},
					success: (
						res
					) => { //返回的数据（不固定，看后端接口，这里是做了一个判断，如果不为true，用uni.showToast方法提示获取数据失败)     // 如果不满足上述判断就输出数据     
						// console.log(res.data.code,'uni.request',options.url)

					}, // 这里的接口请求，如果出现问题就输出接口请求失败    
					fail: (err) => {},
				})
			},
			submit() {
				// if (this.videoTitle == '') {
				// 	uni.showToast({
				// 		title: '视频标题不能为空',
				// 		icon: 'none'
				// 	})
				// 	return
				// }
				if(this.isLoading){
					uni.showToast({
						title: '请勿重复点击',
						icon: 'none'
					})
					return
				}
				this.isLoading = true;
				this.$refs.integalPop.close();
				this.$refs.loadingPop.open();
				console.log(this.isLoading, 'this.isLoading')
				this.hecheng4();




				// lipsync({
				// 	uid: uni.getStorageSync("userId"),
				// 	audioUrl: this.audioUrl,
				// 	videoUrl: this.videoPath,
				// 	integral: this.score,
				// 	title: this.videoTitle
				// }).then(res => {
				// 	console.log(res, 'res')
				// 	// uni.hideLoading();
				// 	// if(res.errno == 0){
				// 	// 	this.showPop1 = false;
				// 	// 	this.audioUrl = '';
				// 	// 	this.videoPath = '';
				// 	// 	this.videoTitle = '';
				// 	// 	this.score = 0;
				// 	// 	uni.switchTab({
				// 	// 		url: '/pages/mine/index'
				// 	// 	})
				// 	// }else {
				// 	// 	uni.showToast({
				// 	// 		title: res.msg,
				// 	// 		icon: 'none'
				// 	// 	})
				// 	// }
				// }).catch(err => {
				// 	uni.hideLoading();
				// 	console.log(err, 'err')
				// })
				// this.showPop1 = false;
				// this.audioUrl = '';
				// this.videoPath = '';
				// this.videoTitle = '';
				// this.audioTitle = '';
				// this.score = 0;
				// this.innerAudioContext.src = '';
				// this.innerAudioContext.stop()
				// this.innerAudioContext.destroy()

				// setTimeout(()=>{
				// 	uni.hideLoading();
				// 	uni.switchTab({
				// 		url: '/pages/mine/index'
				// 	})
				// },2000)


			}
		}
	}
</script>
<style lang="less" scoped>
	/deep/ .u-drawer-bottom {
		background-color: rgba(0, 0, 0, 0) !important;
	}

	/deep/ .u-mode-center-box {
		background-color: rgba(0, 0, 0, 0) !important;
	}

	/deep/ .u-radio__icon-wrap {
		font-size: 13px !important;
	}

	/deep/ .u-radio__label {
		color: #00e18e !important;
		font-size: 24rpx !important;
	}

	/deep/ .u-radio-group {
		width: 100%;
		white-space: nowrap;
	}
</style>
<style>
	@import url(../../static/css/common.css);


	.mt-17 {
		/* margin-top: 34rpx; */
	}

	.mt-10 {
		margin-top: 10rpx;
	}

	page {
		background-color: #111113;
	}

	.page {

		height: 100%;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
	}

	.section {
		padding: 35rpx 0 49rpx;
	}



	.group {
		margin-top: 43rpx;
		padding: 0 30rpx;
		padding-bottom: 150rpx;
	}

	.section_2 {
		/* padding: 276rpx 0 282rpx; */
		height: 656rpx;
		width: 369rpx;
		background-color: #212123;
		border-radius: 8rpx;
		width: 370rpx;
		border: 1rpx solid #414141;
	}

	.history-list {
		/* width: 140rpx; */
		/* height: 656rpx; */
		/* overflow-y: scroll; */
		/* padding: 20rpx; */
	}


	.image_2 {
		margin-right: 6rpx;
		width: 35rpx;
		height: 35rpx;
	}

	.add-video-img {
		width: 134rpx;
		height: 113rpx;
		margin-bottom: 41rpx;
	}

	.del-img {
		width: 22rpx;
		height: 22rpx;
	}

	.del-video {
		position: absolute;
		right: 0;
		top: 0;
		width: 60rpx;
		height: 60rpx;
		border-radius: 0 0 0 50%;
		background-color: #fff;
		text-align: center;
		line-height: 60rpx;
	}

	.font {
		font-size: 32rpx;
		font-family: PingFang SC;
		/* line-height: 31rpx; */
		font-weight: 500;
		color: #ffffff;
	}

	.section_3 {
		padding: 26rpx 29rpx 29rpx;
		background-color: #212123;
		border-radius: 16rpx;
	}

	.select-audio {
		border-radius: 29rpx;
		width: 160rpx;
		height: 60rpx;
		border: 2rpx solid #00e586;
		color: #00e586;
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 60rpx;
		text-align: center;
	}

	.section_4 {
		background-color: #1a1a1c;
		border-radius: 20rpx;
		height: 100rpx;
		border: 1rpx solid #444446;
		padding-left: 20rpx;

	}

	.image_3 {
		width: 30rpx;
		height: 30rpx;
		margin-right: 14rpx;
	}


	.text_2 {
		color: #ffffff;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 29rpx;
	}

	.group_2 {
		position: fixed;
		bottom: 20rpx;
		left: 0;
	}

	.section_5 {
		margin: 0 30rpx;
		width: 690rpx;
		background-image: linear-gradient(90deg, #00ccbb 0%, #00e586 100%);
		border-radius: 50rpx;
		height: 100rpx;
	}

	.image_check {
		width: 30rpx;
		height: 30rpx;
		margin-right: 10rpx;
	}



	.video-wrap {
		height: 656rpx;
		width: 370rpx;
	}

	.video-class {
		width: 370rpx;
		height: 655rpx;
	}

	.ml-3-5 {
		margin-left: 7rpx;
	}

	.section_33 {
		padding: 27rpx 18rpx 17rpx;
		background-color: #39444069;
		border-radius: 20rpx;
	}

	.section_33_lf {
		width: 90%;
	}

	.image_33 {
		width: 81rpx;
		height: 74rpx;
	}

	.image_34 {
		width: 33rpx;
		height: 36rpx;
	}

	.text_44 {
		color: #ffffff;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 31rpx;
		width: 100%;
		word-break: break-all;
	}

	.text_status {
		color: #00e586;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 31rpx;
	}

	.num {
		font-size: 32rpx;
		font-family: PingFang SC;
		line-height: 31rpx;
		font-weight: 500;
		color: #ffffff;
		margin-bottom: 20rpx;
	}

	.num-green {
		color: #00e489;
		font-size: 40rpx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 30rpx;
		margin: 0 6rpx;
	}

	.popup1 {
		/* // margin-right: 40rpx; */
		padding: 59rpx 28rpx 30rpx;
		border-radius: 32rpx;
		background-image: url('https://terminator.axu9.com/images/video-pop-bg.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
		width: 615rpx;
		/* // height: 616rpx; */
	}

	.title1 {
		font-size: 32rpx;
		font-family: PingFang SC;
		line-height: 31rpx;
		font-weight: 500;
		color: #ffffff;
	}

	.input-wrap {
		padding: 41rpx 0;
		border-radius: 16rpx;
		width: 542rpx;
		border: 1rpx solid #ffffff;
		margin-top: 35rpx;
	}

	.input-class1 {
		margin-left: 30rpx;
		color: #ffffff;
		font-size: 28rpx;
		font-family: PingFang SC;
		line-height: 26rpx;
	}

	.input-placeholder1 {
		color: #ffffff;
		font-size: 28rpx;
		font-family: PingFang SC;
		line-height: 26rpx;
	}


	.bottom-btn {
		margin-top: 35rpx;
	}

	.agree-btn {
		padding: 34rpx 0;
		flex: 1 1 257rpx;
		border-radius: 16rpx;
		height: 102rpx;
		border-left: solid 2rpx #00e586;
		border-right: solid 2rpx #00e586;
		border-top: solid 2rpx #00e586;
		border-bottom: solid 2rpx #00e586;
	}

	.font-agree {
		color: #ffffff;
		font-size: 32rpx;
		font-family: PingFang SC;
		line-height: 31rpx;
		font-weight: 500;
	}

	.noagree-btn {
		margin-right: 5rpx;
		padding: 34rpx 0;
		flex: 1 1 257rpx;
		background-image: linear-gradient(90deg, #00ccbb 0%, #00e586 100%);
		border-radius: 16rpx;
		height: 100rpx;
	}

	.border-green {
		border: 1rpx solid #08f9a7;
	}

	.video-poster {
		/* width: 327rpx; */
		height: 140rpx;
		width: 140rpx;
		/* height: 450rpx; */
		border-radius: 14rpx;
		/* margin-bottom: 20rpx; */
		/* border: 1rpx solid red; */
	}

	.close-video-img-wrap {
		position: absolute;
		right: -20rpx;
		top: -15rpx;
		width: 40rpx;
		height: 40rpx;
		border-radius: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #00e489;
	}

	.close-video-img {
		width: 20rpx;
		height: 20rpx;

	}

	.agreement-text1 {
		color: #999999;
		font-weight: 400;
		font-face: PingFang SC;
		font-size: 24rpx;
	}

	.agreement-text2 {
		color: #00db9c;
		font-weight: 500;
		font-face: PingFang SC;
		font-size: 24rpx;
	}
</style>